package com.xizi.秋招笔试;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-8-8上午 09:56
 */

public class A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int T = scanner.nextInt();
        while (T-- > 0) {
            int n = scanner.nextInt();
            int k = scanner.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = scanner.nextInt();
            }
            Arrays.sort(arr);
//            1 2 3 4 5 5  k=6
            if (k == n) {
                if (arr[n - 1] == k) {
                    System.out.println("NO");
                } else {
                    int res = arr[n - 1] + 1;
                    System.out.println("YES");
                    System.out.println(res);
                }
            } else {
                if (arr[k - 1] == arr[k]) {
                    System.out.println("NO");
                } else {
                    int res = arr[k - 1] + 1;
                    System.out.println("YES");
                    System.out.println(res);
                }
            }
        }

    }
}
